package com.infore.dataAudit.service.audit;

import java.util.Map;

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;

import com.infore.dataAudit.util.SpringUtil;

public class AutomaticAuditImpl implements JavaDelegate {

    @Override
    public void execute(DelegateExecution execution) throws Exception {
        Map<String, Object> params = execution.getVariables();
        params.put("flowId", execution.getProcessInstanceId());
        System.out.println(params.get("stationMn") +" ---------");
        System.out.println("自动审核任务开始执行eventName: " +execution.getEventName());
        System.out.println("自动审核任务开始执行ActivityName: " +execution.getCurrentActivityName());
        //开启自动审核
        AutomaticAuditService automaticAuditService = (AutomaticAuditService) SpringUtil.getBean("automaticAuditService");
        automaticAuditService.startAutomaticAudit(params);
        System.out.println("自动审核完成");
    }
    
    

    

}
